package org.example.design.decorator.itf.impl;

import org.example.design.decorator.itf.HandlerInterceptor;

/**
 * @Classname SsoDecorator
 * @Description 装饰抽象基类
 * 装饰器实现的重点是对抽象类接口方式的使用，同时设定被继承的接口可以通过构造函数传递其实现类，
 * 由此增加扩展性并重写方法里可以实现此部分父类实现的功能。
 * @Date 2020/11/5 10:04 上午
 * @Created by xiangjd
 */
public abstract class SsoDecorator  implements HandlerInterceptor {
    private HandlerInterceptor handlerInterceptor;

    public SsoDecorator() {
    }

    public SsoDecorator(HandlerInterceptor handlerInterceptor) {
        this.handlerInterceptor = handlerInterceptor;
    }

    @Override
    public boolean prehandle(String requset, String response, Object handle) {
        return handlerInterceptor.prehandle(requset, response, handle);
    }
}
